<?php
namespace Home\Controller;

use Think\Controller;

class PublicController extends Controller
{
	public function comment(){
		$classify = M('classify');
		$classify1 = $classify->where(array('fid'=>0))->select();
		foreach($classify1 as &$c){
			$c['class'] = $classify->where(array('fid'=>$c['id']))->select();
			foreach($c['class'] as &$cl){
			$cl['class'] = $classify->where(array('fid'=>$cl['id']))->select();
			}
		}
		$flow = D('flow')->where(array('uid'=>session('id')))->select();
		$flow_count = count($flow);
		$this->assign('flow_count',$flow_count);
		$this->assign('class',$classify1);
		$this->display();
	}

	// public function digui($fid,$arr = array(),$lv){
 //        $lv++;
 //        $res = D('classify')->where(array('fid'=>$fid))->select();
 //        if($res){
 //            foreach($res as $v){
 //                $v['lv'] = $lv;
 //                $arr[] = $v;
 //                $arr = $this->digui($v['id'],$arr,$lv);
 //            }
 //        }
 //        return $arr;
 //    }
}
